package com.yunhe.java.day02;

/**
 * Created by Administrator on 2017/7/19 0019.
 */
public class WhileAndFor {

    public static void main(String[] args) {
////        int a=0;
////        int s=0;
////        while (a<100){
////            a=a+1;
////            s=s+a;
////        int a=0;
////        int s=0;
////        do {
////          a++;
////          s+=a;
////        }
////        while (a<100);
////        System.out.print(s);
////        int s=0;
////        for(int i=0;i<=100;i++){
////            if(i%2==0) {
////                s = s + i;
////            }
////        }
////      System.out.println(s);
////        System.out.println("100以内的偶数和"+s);
////        int a;
////        for (int i = 1; i <= 9; i++) {
////            for (int j = 1; j <= 9 - i; j++) {
////                a = i * j;
////                System.out.print(j + "x" + i + "=" + a + "\t");
//            }
//                System.out.println();
//    }
//}
        for (int i = 100; i <= 99999; i++) {
            int len = (i + "").length();
            long sum = 0;
            for (int j = 0; j < len; j++) {
                long a = (long) (i / (Math.pow(10, j))) % 10;
                sum += Math.pow(a, len);
            }
            if (sum == i) {
                System.out.println(i);
            }
        }
        for(int i = 0; i <= 5; i++) {
            System.out.println(i );
        }

    }






            }




